/**
 * Witontek.com.
 * Copyright (c) 2012-2017 All Rights Reserved.
 */
package com.mxl.devtool;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Long
 * @version $Id: StudentsConverter.java, v 0.1 2017年7月4日 上午9:06:24  xiaolong.ma  Exp $
 */
public class StudentsConverter {
    public static StudentsDo convert(Students model) {
        if (model == null) {
            return null;
        }
        StudentsDo ret = new StudentsDo();
        ret.setStudentUuid(model.getStudentUuid());
        ret.setStudentNum(model.getStudentNum());
        ret.setName(model.getName());
        ret.setEnrolYear(model.getEnrolYear());
        ret.setIdcardNum(model.getIdcardNum());
        ret.setInstituteId(model.getInstituteId());
        ret.setMajorId(model.getMajorId());
        ret.setClassId(model.getClassId());
        ret.setCellphone(model.getCellphone());
        ret.setEmail(model.getEmail());
        ret.setUpdateTime(model.getUpdateTime());
        ret.setCreateTime(model.getCreateTime());
        ret.setMemo(model.getMemo());
        ret.setSchoolId(model.getSchoolId());
        ret.setStatus(model.getStatus());
        ret.setIdcardType(model.getIdcardType());
        ret.setTradePwd(model.getTradePwd());
        ret.setTradePwdSalt(model.getTradePwdSalt());
        ret.setAutokey(model.getAutokey());
        ret.setIsshortinfor(model.getIsshortinfor());
        ret.setStudentSn(model.getStudentSn());
        ret.setIsNewStudents(model.getIsNewStudents());
        ret.setHomeAddress(model.getHomeAddress());
        ret.setGender(model.getGender());
        ret.setBirthday(model.getBirthday());
        return ret;
    }

    public static Students convert(StudentsDo modelDo) {
        if (modelDo == null) {
            return null;
        }
        Students ret = new Students();
        ret.setStudentUuid(modelDo.getStudentUuid());
        ret.setStudentNum(modelDo.getStudentNum());
        ret.setName(modelDo.getName());
        ret.setEnrolYear(modelDo.getEnrolYear());
        ret.setIdcardNum(modelDo.getIdcardNum());
        ret.setInstituteId(modelDo.getInstituteId());
        ret.setMajorId(modelDo.getMajorId());
        ret.setClassId(modelDo.getClassId());
        ret.setCellphone(modelDo.getCellphone());
        ret.setEmail(modelDo.getEmail());
        ret.setUpdateTime(modelDo.getUpdateTime());
        ret.setCreateTime(modelDo.getCreateTime());
        ret.setMemo(modelDo.getMemo());
        ret.setSchoolId(modelDo.getSchoolId());
        ret.setStatus(modelDo.getStatus());
        ret.setIdcardType(modelDo.getIdcardType());
        ret.setTradePwd(modelDo.getTradePwd());
        ret.setTradePwdSalt(modelDo.getTradePwdSalt());
        ret.setAutokey(modelDo.getAutokey());
        ret.setIsshortinfor(modelDo.getIsshortinfor());
        ret.setStudentSn(modelDo.getStudentSn());
        ret.setIsNewStudents(modelDo.getIsNewStudents());
        ret.setHomeAddress(modelDo.getHomeAddress());
        ret.setGender(modelDo.getGender());
        ret.setBirthday(modelDo.getBirthday());
        return ret;
    }

    public static List<Students> convertList(List<StudentsDo> doList) {
        if ((doList == null) || (doList.size() < 1)) {
            return null;
        }
        List<Students> list = new ArrayList<Students>();
        for (StudentsDo modelDo : doList) {
            Students model = convert(modelDo);
            list.add(model);
        }
        return list;
    }

}
